<?php

class admin{
	
	public $new_usu;
	public $new_pass;
	public $new_nombre;
	public $new_apell;
	public $new_creacion;
	
	
	public function cap_form_usu(){
		require_once('../model/m_adm.php');
		$this->new_pass= $_GET['pass'];
		$this->new_usu= $_GET['codusu'];
		$this->new_nombre= $_GET['nombre'];
		$this->new_apell= $_GET['apellido'];
		$this->new_creacion= $_GET['date'];	
		
		guardar_usuario($this->new_usu,$this->new_pass,$this->new_nombre,$this->new_apell,$this->new_creacion);
		
		$this->mostrar_admin_lev1();
	}
	
	public function mostrar_admin_lev1(){
	
		include_once("../view/v_header_pag_prin.html");

		echo "<h1>AREA DE ADMINISTRACION</h1>";
		include_once("../view/v_admin_form.html");

		include_once("../view/v_footer_pag_princ.html");
	}	
	
	public function mostrar_admin(){
	
		include_once("view/v_header_pag_prin.html");

		echo "<h1>AREA DE ADMINISTRACION</h1>";
		include_once("view/v_admin_form.html");

		include_once("view/v_footer_pag_princ.html");
	}
	
	
	
	public function crear_usuario(){		
		
		include_once("../view/v_header_pag_prin.html");
		echo "<h1>AREA DE CREACION DE USUARIO</h1>";
		include_once("../view/_admin_form.html");
		include_once("../view/v_footer_pag_princ.html");
	}

}

$instancia= new admin;

if(isset($_GET['codusu'])){

	$instancia->cap_form_usu();
	
} else if(isset($_GET['crear'])){

	if($_GET['crear']==1){
	
		$instancia->crear_usuario();
		
	}
}  else {
		$instancia->mostrar_admin();
	}

?>